package top.yangbuyi;


import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @description: 杨不易网站:www.yangbuyi.top
 * @program: yangbuyiopenHis2020
 * @ClassName: ErpApplication
 * @create: 2020-08-27 08:46
 * @author: yangbuyi
 * @since： JDK1.8
 * @ErpApplication:
 **/
@SpringBootApplication
@Slf4j
@EnableDubbo
@MapperScan(basePackages = {"top.yangbuyi.mapper"})
public class ErpApplication {
	  public static void main(String[] args) throws UnknownHostException {
			ConfigurableApplicationContext application = SpringApplication.run(ErpApplication.class, args);
			Environment env = application.getEnvironment();
			String ip = InetAddress.getLocalHost().getHostAddress();
			String port = env.getProperty("server.port");
			String path = env.getProperty("server.servlet.context-path");
			String serverName = env.getProperty("spring.application.name");
			String active = env.getProperty("spring.profiles.active");
			String fileExtension = env.getProperty("spring.cloud.nacos.config.file-extension");
			log.info("\n--------------------------------------------------------------------------\n\t" +
					"|                    欢迎使用ERP进销存子模块模块      \t\t\t\t\t" + "|\n\t" +
					"|Application yangbuyi-his is running! Access URLs:\t\t\t\t\t" + "|\n\t" +
					"|访问URL: \t\thttp://localhost:" + port + path + "/\t\t\t\t\t" + "|\n\t" +
					"|当前配置环境: \t\t当前环境为:" + active + "\t\t\t\t\t\t\t\t\t" + "|\n\t" +
					"|配置文件名称: \t\t" + serverName + "-" + active + "." + fileExtension + "\t\t\t\t\t\t\t|\n\t" +
					"---------------------------------------------------------------------");
			log.info("\n __   __  ____   __   __          _   _     ___     ____            _____   ____    ____  \n" +
					" \\ \\ / / | __ )  \\ \\ / /         | | | |   |_ _|   / ___|          | ____| |  _ \\  |  _ \\ \n" +
					"  \\ V /  |  _ \\   \\ V /   _____  | |_| |    | |    \\___ \\   _____  |  _|   | |_) | | |_) |\n" +
					"   | |   | |_) |   | |   |_____| |  _  |    | |     ___) | |_____| | |___  |  _ <  |  __/ \n" +
					"   |_|   |____/    |_|           |_| |_|   |___|   |____/          |_____| |_| \\_\\ |_|    \n" +
					"                                                                                          ");



	  }

}
